<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Cryptophone on C#: Cryptophone2.MySocket Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Cryptophone on C#
   </div>
   <div id="projectbrief">The new Graphical Interface for CryptoPhone</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Packages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespace_cryptophone2.html">Cryptophone2</a></li><li class="navelem"><a class="el" href="class_cryptophone2_1_1_my_socket.html">MySocket</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="class_cryptophone2_1_1_my_socket-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Cryptophone2.MySocket Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a45cb13d746ee5c374653c5212b09309e"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_cryptophone2_1_1_my_socket.html#a45cb13d746ee5c374653c5212b09309e">CreaSocket</a> (StringBuilder ipNumber, int numero, StringBuilder returnIp)</td></tr>
<tr class="memdesc:a45cb13d746ee5c374653c5212b09309e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wrapping for DLL function <a class="el" href="class_cryptophone2_1_1_my_socket.html#a6c2310146b4796e52db8f987a97ae3f2">sock_crea()</a>. This function initializes sockets for communications  <a href="#a45cb13d746ee5c374653c5212b09309e"></a><br/></td></tr>
<tr class="memitem:ac4bf1f74362fa347511e5dfed05918de"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_cryptophone2_1_1_my_socket.html#ac4bf1f74362fa347511e5dfed05918de">ChiudiSocket</a> ()</td></tr>
<tr class="memdesc:ac4bf1f74362fa347511e5dfed05918de"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wrapping for DLL function <a class="el" href="class_cryptophone2_1_1_my_socket.html#a14aba84cbec6b7ad76bb895180cbddaf">sock_chiudi()</a>. This function closes all communication sockets  <a href="#ac4bf1f74362fa347511e5dfed05918de"></a><br/></td></tr>
<tr class="memitem:a59cfd0a556b52217bff95897fd0b7761"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_cryptophone2_1_1_my_socket.html#a59cfd0a556b52217bff95897fd0b7761">ScambioChiaviSocket</a> (StringBuilder keyTX, StringBuilder keyRX, StringBuilder keyVocal)</td></tr>
<tr class="memdesc:a59cfd0a556b52217bff95897fd0b7761"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wrapping for DLL function <a class="el" href="class_cryptophone2_1_1_my_socket.html#a0194339bb55d2180a0bf645c9241ffe2">sock_scambioChiavi()</a>. This function is the core of security. It's used to create and exchange public and private key. It's generate also SAS keyString to avoid man in the middle attack  <a href="#a59cfd0a556b52217bff95897fd0b7761"></a><br/></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr class="memitem:a6c2310146b4796e52db8f987a97ae3f2"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_cryptophone2_1_1_my_socket.html#a6c2310146b4796e52db8f987a97ae3f2">sock_crea</a> ([MarshalAs(UnmanagedType.LPWStr)] StringBuilder ipNumber, int numero,[MarshalAs(UnmanagedType.LPWStr)] StringBuilder returnIp)</td></tr>
<tr class="memitem:a14aba84cbec6b7ad76bb895180cbddaf"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_cryptophone2_1_1_my_socket.html#a14aba84cbec6b7ad76bb895180cbddaf">sock_chiudi</a> ()</td></tr>
<tr class="memitem:a0194339bb55d2180a0bf645c9241ffe2"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_cryptophone2_1_1_my_socket.html#a0194339bb55d2180a0bf645c9241ffe2">sock_scambioChiavi</a> ([MarshalAs(UnmanagedType.LPWStr)] StringBuilder keyTX,[MarshalAs(UnmanagedType.LPWStr)] StringBuilder keyRX,[MarshalAs(UnmanagedType.LPWStr)] StringBuilder keyVocal)</td></tr>
</table>
<a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock">
<p>Definition at line <a class="el" href="_my_socket_8cs_source.html#l00009">9</a> of file <a class="el" href="_my_socket_8cs_source.html">MySocket.cs</a>.</p>
</div><h2>Member Function Documentation</h2>
<a class="anchor" id="ac4bf1f74362fa347511e5dfed05918de"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void Cryptophone2.MySocket.ChiudiSocket </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Wrapping for DLL function <a class="el" href="class_cryptophone2_1_1_my_socket.html#a14aba84cbec6b7ad76bb895180cbddaf">sock_chiudi()</a>. This function closes all communication sockets </p>

<p>Definition at line <a class="el" href="_my_socket_8cs_source.html#l00045">45</a> of file <a class="el" href="_my_socket_8cs_source.html">MySocket.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a45cb13d746ee5c374653c5212b09309e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int Cryptophone2.MySocket.CreaSocket </td>
          <td>(</td>
          <td class="paramtype">StringBuilder&#160;</td>
          <td class="paramname"><em>ipNumber</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>numero</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">StringBuilder&#160;</td>
          <td class="paramname"><em>returnIp</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Wrapping for DLL function <a class="el" href="class_cryptophone2_1_1_my_socket.html#a6c2310146b4796e52db8f987a97ae3f2">sock_crea()</a>. This function initializes sockets for communications </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ipNumber</td><td>Ip of server (used only by client)</td></tr>
    <tr><td class="paramname">numero</td><td>Direction of connection 0 = ServerSide, 1 = ClientSide</td></tr>
    <tr><td class="paramname">returnIp</td><td>Output Parameter. Used in ServerSide mode to returning ip fo Client</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>if return 0, communication is setted and ready to use. </dd></dl>

<p>Definition at line <a class="el" href="_my_socket_8cs_source.html#l00035">35</a> of file <a class="el" href="_my_socket_8cs_source.html">MySocket.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a59cfd0a556b52217bff95897fd0b7761"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int Cryptophone2.MySocket.ScambioChiaviSocket </td>
          <td>(</td>
          <td class="paramtype">StringBuilder&#160;</td>
          <td class="paramname"><em>keyTX</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">StringBuilder&#160;</td>
          <td class="paramname"><em>keyRX</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">StringBuilder&#160;</td>
          <td class="paramname"><em>keyVocal</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Wrapping for DLL function <a class="el" href="class_cryptophone2_1_1_my_socket.html#a0194339bb55d2180a0bf645c9241ffe2">sock_scambioChiavi()</a>. This function is the core of security. It's used to create and exchange public and private key. It's generate also SAS keyString to avoid man in the middle attack </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">keyTX</td><td>output parameter. Transmitting key </td></tr>
    <tr><td class="paramname">keyRX</td><td>output parameter. Reciving key</td></tr>
    <tr><td class="paramname">keyVocal</td><td>output parameter. SAS key</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>return 0 for success</dd></dl>

<p>Definition at line <a class="el" href="_my_socket_8cs_source.html#l00061">61</a> of file <a class="el" href="_my_socket_8cs_source.html">MySocket.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a14aba84cbec6b7ad76bb895180cbddaf"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void Cryptophone2.MySocket.sock_chiudi </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a6c2310146b4796e52db8f987a97ae3f2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int Cryptophone2.MySocket.sock_crea </td>
          <td>(</td>
          <td class="paramtype">[MarshalAs(UnmanagedType.LPWStr)] StringBuilder&#160;</td>
          <td class="paramname"><em>ipNumber</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>numero</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">[MarshalAs(UnmanagedType.LPWStr)] StringBuilder&#160;</td>
          <td class="paramname"><em>returnIp</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a0194339bb55d2180a0bf645c9241ffe2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int Cryptophone2.MySocket.sock_scambioChiavi </td>
          <td>(</td>
          <td class="paramtype">[MarshalAs(UnmanagedType.LPWStr)] StringBuilder&#160;</td>
          <td class="paramname"><em>keyTX</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">[MarshalAs(UnmanagedType.LPWStr)] StringBuilder&#160;</td>
          <td class="paramname"><em>keyRX</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">[MarshalAs(UnmanagedType.LPWStr)] StringBuilder&#160;</td>
          <td class="paramname"><em>keyVocal</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>Cryptophone2/<a class="el" href="_my_socket_8cs_source.html">MySocket.cs</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Jul 21 2012 23:56:53 for Cryptophone on C# by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.2
</small></address>
</body>
</html>
